package com.yupi.springbootinit.rpc.IMPL;

import com.yupi.springbootinit.rpc.RpcDemoService;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;

/**
 * @ClassName RpcDemoServiceImpl
 * @Description
 * @Author junjun
 * @Date 2023/6/3 22:22
 * @Version V1.0
 */
@DubboService
public class RpcDemoServiceImpl implements RpcDemoService {
    @Override
    public String sayHello(String name) {
        System.out.println("Hello " + name + ", request from consumer: " + RpcContext.getContext().getRemoteAddress());
        return "Hello " + name;
    }
}